import axiosIns from '../../utils/request'

export default {
  getAttrList (id, params) {
    return axiosIns.get(`categories/${id}/attributes`, params)
  },

  addAttr (id, data) {
    return axiosIns.post(`categories/${id}/attributes`, data)
  },

  editAttr (id, attrId, data) {
    return axiosIns.put(`categories/${id}/attributes/${attrId}`, data)
  },

  deleteAttr (id, attrid) {
    return axiosIns.delete(`categories/${id}/attributes/${attrid}`)
  },

  addCategories (id, attrId, data) {
    return axiosIns.put(`categories/${id}/attributes/${attrId}`, data)
  },

  deleteCategories (id, attrid) {
    return axiosIns.delete(`categories/${id}/attributes/${attrid}`)
  }
}
